#include <iostream>
using namespace std;

int main(int argc, char * argv[])
{
    char str1[] = "hello world";
    char str2[] = "hello world";
    // C++把常量字符串放到一个单独的内存区域，当几个指针赋值给相同的常量字符串的时候
    // 它们实际上会指向相同的内存地址。
    char * str3 = "hello world";
    char * str4 = "hello world";

    if (str1 == str2)
        cout << "str1 and str2 are same." << endl;
    else
        cout << "str1 and str2 are not same." << endl;

    if (str3 == str4)
        cout << "str3 and str4 are same." << endl;

    return 0;
}
